package com.example.springboottest.example.workflow;

import org.kie.api.runtime.process.WorkItem;
import org.kie.api.runtime.process.WorkItemHandler;
import org.kie.api.runtime.process.WorkItemManager;

/**
 * 模拟完成任务流程
 * 
 * @author fangdaye
 *
 */
public class TestWorkItemHandler implements WorkItemHandler {

	public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
		System.out.println("Executing work item " + workItem);

		manager.completeWorkItem(workItem.getId(), null);
	}

	public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {
		System.out.println("Aborting work item " + workItem);
		manager.abortWorkItem(workItem.getId());
	}

}
